//
//  MadTaskDetailsViewController.m
//  MadGTD
//
//  Created by Fuzhou Chen on 5/1/12.
//  Copyright (c) 2012 Fuzhou Chen. All rights reserved.
//

#import "MadTodoDetailsViewController.h"

@interface MadTodoDetailsViewController ()

@end

@implementation MadTodoDetailsViewController

- (id)initWithGTDModel:(MadGTDModel*)model
{
    MAD_CHK_PARAM_OR_TERMINATE(model != nil, ("model == nil"));
    self = [super initWithNibName:nil bundle:nil];
    if (self) {
        _model = [model retain];
    }
    return self;
}

- (void)dealloc
{
    [_model release];
    [super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

-(void) viewWillAppear:(BOOL)animated {
    [self.navigationController setToolbarHidden:YES animated:YES];
    [super viewWillAppear:animated];
}


-(void) viewWillDisappear:(BOOL)animated {
    if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) {
        // back button was pressed.  We know this is true because self is no longer
        // in the navigation stack.
        [self.navigationController setToolbarHidden:NO animated:YES];
    }
    [super viewWillDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
